<template>
  <Tabs>
    <!-- 过渡效果放在keep-alive外层，否则渲染时会导致router-view中的组件销毁重建 -->
    <transition name="component-fade" mode="out-in">
      <template>
        <keep-alive>
          <router-view></router-view>
        </keep-alive>
      </template>
    </transition>
  </Tabs>
</template>

<script>
  import Tabs from './Tabs'
  import Tab from './Tab'
  import {SET_AUTHORIZED_MENU, SET_AUTHORIZED_MENU_FUNCTION} from "../../store/mutationTypes"
  import {doGet} from "../../assets/js/utils/RequestUtils"

  export default {
    name: "AppContent",
    methods: {
      //全局数据初始化
      fetchData() {
        doGet("/menu/getAuthorizedMenu", {component:this})
          .then(response=>this.$store.commit(SET_AUTHORIZED_MENU, response));
        doGet("/menuFunction/getAuthorizedMenuFunction", {component:this})
          .then(response=>this.$store.commit(SET_AUTHORIZED_MENU_FUNCTION, response));
      }
    },
    created() {
      this.fetchData();
    },
    components: {Tabs}
  }
</script>

<style scoped>
  .component-fade-enter-active, .component-fade-leave-active {
    transition: opacity .1s ease;
  }
  .component-fade-enter, .component-fade-leave-active {
    opacity: 0;
  }
</style>



// WEBPACK FOOTER //
// AppContent.vue?7da38a23
